/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.bld.model.telefone;

import br.com.bld.util.facade.BLDDataErro;

/**
 *
 * @author Pedro
 */
public class TelefoneEntity implements BLDDataErro {

    public static final String CLASS_ID = "TelefoneEntity";

    private Long numrFone;      //numeric(14,0) NOT NULL,
    private Long numrFax;       //numeric(14,0),
    private String email;       //character varying(255),
    private String website;     //character varying(255)

    public static final String CAMPO_FONE = "Fone";
    public static final String CAMPO_FAX = "Fax";
    public static final String CAMPO_EMAIL = "e-mail";
    public static final String CAMPO_WEB_SITE = "Web Site";

    /**
     * @return the numrFone
     */
    public Long getNumrFone() {
        return numrFone;
    }

    /**
     * @param numrFone the numrFone to set
     */
    public void setNumrFone(Long numrFone) {

        if (numrFone == null) {
            throw new IllegalArgumentException(String.format(CAMPO_OBRIGATORIO, CAMPO_FONE));
        }
        if (numrFone <= 0) {
            throw new IllegalArgumentException(VALOR_NAO_PERMITIDO);
        }

        this.numrFone = numrFone;
    }

    /**
     * @return the numrFax
     */
    public Long getNumrFax() {
        return numrFax;
    }

    /**
     * @param numrFax the numrFax to set
     */
    public void setNumrFax(Long numrFax) {

        if (numrFax != null && numrFax <= 0) {
            throw new IllegalArgumentException(VALOR_NAO_PERMITIDO);
        }

        this.numrFax = numrFax;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {

        if (email != null && email.length() > 255) {
            throw new IllegalArgumentException(TAMANHO_MAX_MAIOR);
        }

        this.email = email;
    }

    /**
     * @return the website
     */
    public String getWebsite() {
        return website;
    }

    /**
     * @param website the website to set
     */
    public void setWebsite(String website) {
        
        if (website != null && website.length() > 255) {
            throw new IllegalArgumentException(TAMANHO_MAX_MAIOR);
        }

        this.website = website;
    }

}
